# 字符串的切片操作
s = 'hello,world'
s1 = s[:5]
s2 = s[6:]
newStr = s1 + '!' + s2
print(newStr)
newStr2 = s1 + ',' + s2
print(newStr2)
print(newStr2 is s)
print(id(s), id(newStr), id(newStr2))  # 三个字符串的id都不同

# 切片[start:end:step]
print(s[::2])
